/*
 * 作者：姚俊
 * 功能：学科管理员登陆的action
 * 日期：2015-05-22
 */
package admin.action.baseInfo;
import java.util.*;

import teacher.bean.Teacher;

import com.opensymphony.xwork2.ActionContext;

import admin.bean.Note;
import admin.service.fruits.NoteService;

public class AdminBaseAction {
	
	private int receiveCount;
	private int sendCount;
	private List<Note> notes;

	public int getReceiveCount() {
		return receiveCount;
	}

	public void setReceiveCount(int receiveCount) {
		this.receiveCount = receiveCount;
	}

	public int getSendCount() {
		return sendCount;
	}

	public void setSendCount(int sendCount) {
		this.sendCount = sendCount;
	}

	public List<Note> getNotes() {
		return notes;
	}

	public void setNotes(List<Note> notes) {
		this.notes = notes;
	}

	public String execute()
	{
		Teacher teacher=(Teacher)ActionContext.getContext().getSession().get("admin");
		System.out.println("我是从这里跳过来的");
		//找出未读留言的数量
		Note n=new Note();
		n.setToUser(teacher.getTeaId());
		n.setState(0);
		this.setReceiveCount(new NoteService().selectCountAllNote(n));
		ActionContext.getContext().getSession().put("receiveCount", this.getReceiveCount());
		System.out.println("成功了");
		return "succ";
	}

}
